use "..\final_2.dta", clear


*Table 1 Panel C
local tablename "tab_1c"
local table=1
local col=1
estimates clear

foreach var of varlist credit current_sems java_know sex {
reg `var' warm team warm_team , cluster(date_room)
su `var' if warm == 0 & team == 0
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'

}

esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm team warm_team, relax) ///		   
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))	
			   


*Table 3 Panel C
local tablename "tab_3c"
local table=1
local col=1
estimates clear

foreach var of varlist q6_partner_5 diff_teammate_prefer {
reg `var' warm team_sex_mix warm_sex_mix, cluster(date_room)
su `var' if warm == 0 & team == 1 & team_sex_mix == 0
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'
}


esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm team_sex_mix warm_sex_mix , relax) ///
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))

*Table 4 Panel C
local tablename "tab_4c"
local table=1
local col=1
estimates clear


foreach var of varlist q6_partner_5 diff_teammate_prefer {

reg `var' warm team_exp_mix warm_exp_mix , cluster(date_room)
su `var' if warm == 0 & team == 1 & team_exp_mix == 0
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'

}

esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm team_exp_mix warm_exp_mix, relax) ///
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))


			   
			   
*Table 5 Panel C
local tablename "tab_5c"
local table=1
local col=1
estimates clear

foreach var of varlist q6_partner_5 diff_teammate_prefer {
reg `var' warm dissimilar_2 dissimilar_3  warm_dissimilar_2 warm_dissimilar_3, cluster(date_room)
su `var' if warm == 0 & team == 1 & dissimilar_1 == 1
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'
}

*/

esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm dissimilar_2 dissimilar_3 warm_dissimilar_2 warm_dissimilar_3 diss_2 diss_3 diss_4 warm_diss_2 warm_diss_3 warm_diss_4, relax) ///
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))	
			   

			   
*Table A2
local tablename "tab_a2"
local table=1
local col=1
estimates clear

foreach var of varlist q3_difficulty_5 q5_engaging_5 prefer_teammate neg_mood pos_mood  {
reg `var' warm team warm_team, cluster(date_room)
su `var' if warm == 0 & team == 0
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'

}

foreach var of varlist  q6_partner_5 diff_teammate_prefer {
reg `var' warm, cluster(date_room)
su `var' if warm == 0 & team == 1
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'

}

esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm team warm_team, relax) ///
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))
			   
*Table A4
local tablename "tab_a4"
local table=1
local col=1
estimates clear

foreach var of varlist q3_difficulty_5 q5_engaging_5 prefer_teammate neg_mood pos_mood {
reg `var' warm team_sex_mix warm_sex_mix, cluster(date_room)
su `var' if warm == 0 & team == 1 & team_sex_mix == 0
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'
}


esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm team_sex_mix warm_sex_mix team_exp_mix warm_exp_mix, relax) ///
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))
			   
*Table A5
local tablename "tab_a5"
local table=1
local col=1
estimates clear


foreach var of varlist q3_difficulty_5 q5_engaging_5 prefer_teammate neg_mood pos_mood {

reg `var' warm team_exp_mix warm_exp_mix , cluster(date_room)
su `var' if warm == 0 & team == 1 & team_exp_mix == 0
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'

}

esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm team_sex_mix warm_sex_mix team_exp_mix warm_exp_mix, relax) ///
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))		   

*Table A6
local tablename "tab_a6"
local table=1
local col=1
estimates clear

foreach var of varlist q3_difficulty_5 q5_engaging_5 prefer_teammate neg_mood pos_mood {
reg `var' warm dissimilar_2 dissimilar_3  warm_dissimilar_2 warm_dissimilar_3, cluster(date_room)
su `var' if warm == 0 & team == 1 & dissimilar_1 == 1
estadd scalar ymean = r(mean)
estimates store cT`table'C`col++'
}

*/

esttab cT`table'C* using "$outtab/`tablename'.tex", replace f ///
               label booktabs b(3) p(3) eqlabels(none) alignment(S) collabels("\multicolumn{1}{c}{$\beta$ / SE}") ///
               keep (warm dissimilar_2 dissimilar_3 warm_dissimilar_2 warm_dissimilar_3 diss_2 diss_3 diss_4 warm_diss_2 warm_diss_3 warm_diss_4, relax) ///
			   star(* 0.10 ** 0.05 *** 0.01) ///
               cells("b(fmt(2)star)" "se(fmt(2)par)") ///
			   stats(ymean N r2, fmt(2 0 3) layout("\multicolumn{1}{c}{@}") ///
			   labels(`"Control Mean"' `"Observations"' `"\(R^{2}\)"'))	

